<!DOCTYPE HTML>
<html>
  <head>
    <title>Login</title>
        <link rel="SHORTCUT ICON" href="img/favicon.ico" />
        <script type="text/javascript" src="http://maps.google.com/maps?file=api&amp;v=2&amp;key="></script>
        <script type="text/javascript" src="jquery/jquery-1.7.1.min.js"></script>
        <script type="text/javascript" src="jquery/jquery.gmap-1.1.0-min.js"></script>
        <script type="text/javascript" src="jquery/jquery.gmap-1.1..js"></script>
        <script type="text/javascript" src="jquery/slides.jquery.js"></script>          
		<link rel="stylesheet" href="css/style.css" />
        <link rel="stylesheet" href="css/grid-12.css" />
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <script type="text/javascript" language="javascript">
          $('document').ready(function() {
    		});        
				</script>
  </head>
  <body>
    <div id="container" class="container_12">
    
    <?php
    include("inc/db.class.php");
    require("php/header.php");
	require_once('inc/constants.inc.php');
    $database = new database();
    ?>
		  <div id="line" class="grid_12"></div>
      <div id="slides" class="grid_12">
				<form id="" class="grid_12 alpha omega" method="post" action="loginAuthentication.php">
					<div class="grid_6 alpha omega login_block">
						<div class="reg_input_pair_cover">
							<span class="floatLeft">Email *</span>
							<input type="text" id="email" class="textbox_3 floatRight" name="email"  value="Email" onFocus="if(this.value=='Email'){ this.value='';}" onBlur="if(this.value==''){ this.value='Email';}" />
							<div class="clr"></div>
						<div class="clr"></div>
						</div>
						<div class="reg_input_pair_cover">
							<span class="floatLeft">Password *</span>
							<input type="password" id="password" name="password" value="" class="textbox_3 floatRight"  />
							<div class="clr"></div>
						</div>
						<div class="reg_input_pair_cover">
							<a href="#" class="small_font" id="forgot_password"></a>
							<input type="submit" id="sign_in" name=" sign_in"  class="btn2 floatRight" value="Sign in"  />
							<div class="clr"></div>
						</div>
					</div>
					<div class="grid_1 middle_block">Or</div>
					<div class="grid_5  alpha omega right_block">
						<div class="social-login-wrapper">
							<h3>Social Login</h3> <br>

							<?php
								include_once 'src/facebook.php';
								// App name Uttu
								// Create our Application instance (replace this with your appId and secret).
								$facebook = new Facebook(array(
								  'appId'  => APP_ID, //'334619919999877',
								  'secret' => APP_SECRET, //'ec96fb04e9c2ae9782718e1a4cfbc946',
								));

								// Get User ID
								$user = $facebook->getUser();
								
								$params = array(
								  'scope' => 'read_stream, friends_likes, email',
								  'redirect_uri' => 'http://'.SERVER.'/'.ROOT_DIR.'facebook-login-process.php',
								  'display' => 'popup'
								  
								);

								
								if ($user) {
								$params = array( 'next' => 'http://'.SERVER.'/'.ROOT_DIR.'logout.php' );
								  $logoutUrl = $facebook->getLogoutUrl($params);
								  //header("location: index.php");
								  echo "<a href='".$logoutUrl."'>facebook logout</a>";
								  
								} else {
								  $loginUrl = $facebook->getLoginUrl($params);
								   echo "<a href='".$loginUrl."'><img src=\"img/facebook-login-button.png\"/></a></br></br>";
								}
							?>
							
							<?php
							
							
							
							/*
								include_once 'src/facebook.php';
								// App name Uttu
								// Create our Application instance (replace this with your appId and secret).
								$facebook = new Facebook(array(
								  'appId'  => APP_ID, //'334619919999877',
								  'secret' => APP_SECRET, //'ec96fb04e9c2ae9782718e1a4cfbc946',
								));

								// Get User ID
								$user = $facebook->getUser();
								
								$params = array(
								  'scope' => 'read_stream, friends_likes',
								  'redirect_uri' => SERVER.'/'.ROOT_DIR.'/facebook-login-process.php',
								  'display' => 'popup'
								  
								);
echo SERVER.'/'.ROOT_DIR.'/facebook-login-process.php';
								
								if ($user) {
								$params = array( 'next' => SERVER.'/'.ROOT_DIR.'/logout.php' );
								  $logoutUrl = $facebook->getLogoutUrl($params);
								  //header("location: index.php");
								  echo "<a href='".$logoutUrl."'>facebook logout</a>";
								  
								} else {
								  $loginUrl = $facebook->getLoginUrl($params);
								   echo "<a href='".$loginUrl."'><img src=\"img/facebook-login-button.png\"/></a></br></br>";
								}
								*/
							?>
							<a class="social_netowrk_login_link" href="google-openid/login-google.php?login&oauth_provider=google">Login with <img src="img/google.png" height="30" style="margin-bottom: -10px;"/></a>
						</div>
						
					</div>
				</form>
				
				<div>

				
				</div>

				
				
      </div>
      <?php require("php/footer.php"); ?>
    </div>
  </body>
</html>
